fix(worker): retry the GitLab repository catalog step on transient timeouts - #302
Conversation
…meouts Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015kfeohXE66xx7RJPxZ2pvH
|
Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits. |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review available on request
Reviews should be triggered manually for repositories with fewer than 10 stars. Select Trigger review above or comment ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Problem
A single upstream GitLab hiccup fails a whole run. Observed failure:
listFreshRepositoryCatalogStep(agent.ts) hasmaxRetries = 0at the WDK level, so once its internal listing gives up, the run dies and a human has to re-move the ticket back into the AI column. The internal listing already retried (2 attempts, fixed 500ms backoff, 15s per-page timeout), but two consecutive 15s timeouts still exhausted it.Change
All GitLab/GitHub listing goes through
listRepositoriesWithRetryinapps/worker/src/adapters/vcs/repository-directory.ts. Hardened there, surgically:LISTING_MAX_ATTEMPTS) - one more chance to ride out a transient blip. Still bounded, no infinite retry.listingRetryDelayMs): full jitter over[0, 500ms]then[0, 1000ms], capped at 4s, so correlated upstream blips don't all retry in lockstep.GITLAB_PROJECTS_TIMEOUT_MS) - the failure showed GitLab responding slower than 15s, so a modest raise survives genuine slowness.Worst case is
3 * 18s + <=1.5s backoff ~= 55.5s, which stays inside the ~60s pre-sandbox listing budget the surrounding comments reason about (also honored by the dashboard catalog endpoint that shares this path). The listing is already paginated (per_page=100, followsx-next-page), so unbounded fetching was not the cause.Permanent failures still surface unchanged: after the attempts are exhausted the original error (with its clear "GitLab projects list timed out after 18000ms" / status reason) is rethrown, not swallowed.
Tests
apps/worker/src/adapters/vcs/repository-directory.test.ts:Touched-file run: 19 passed.
🤖 Generated with Claude Code
https://claude.ai/code/session_015kfeohXE66xx7RJPxZ2pvH